<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!-- Content Header (Page header) -->
<section class="content-header" style="">
    <h1>
        话费分包
        <small>分包管理页面</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li><a href="#">分包管理</a></li>
        <li class="active">分包管理</li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <!-- /.box-header -->
                <div class="box-body">
                    <div id="toolbar">
                        <form class="form-inline" id="searchForm">
                            <div class="form-group">
                                <label for="searchName"> 客户名</label>
                                <input type="text" class="form-control input-sm" name="username" id="searchName" placeholder="请输入客户名称">
                            </div>
                            <div class="form-group">
                                <label for="searchPhone">手机号码</label>
                                <input type="text" class="form-control input-sm" name="phone" id="searchPhone" placeholder="请输入客户手机">
                            </div>
                            <div class="form-group">
                                <label for="searchstatus">跟进状态</label>
                                <select class="form-control select2" multiple="multiple" id="searchstatus" name="status" style="width: 100%;" data-placeholder="跟进状态" >
                                    <option value="0" text="已办理">已办理</option>
                                    <option value="1" text="有意向">有意向</option>
                                    <option value="2" text="继续跟进">继续跟进</option>
                                    <option value="3" text="未处理">未处理</option>
                                    <option value="4" text="不需要">不需要</option>
                                </select>
                            </div>
                            <div class="btn-group btn-group-sm">
                                <button type="button" class="btn btn-default" onclick="javascript:$('table').bootstrapTable('refresh', {silent: true});">
                                    <i class="glyphicon glyphicon-search"></i>
                                    查询
                                </button>
                                <button type="reset" class="btn btn-default">
                                    <i class="glyphicon glyphicon-trash"></i>
                                    清空
                                </button>
                            </div>
                        </form>
                        <div class="btn-group btn-group-sm">
                            <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
                            <button shiro:hasPermission="customer:create" type="button" id="addBtn" class="btn btn-default"
                                    data-toggle="modal"
                                    data-target="#addModal"><i class="glyphicon glyphicon-plus"></i> 新增
                            </button>
                            <!-- Indicates caution should be taken with this action -->
                            <button shiro:hasPermission="customer:update" type="button" id="editBtn" class="btn btn-default"
                                    data-toggle="modal"
                                    data-target="#editModal"
                                    data-action="{type:'editable',form:'#editForm',table:'#table',after:'editAfter'}"
                                    disabled><i class="glyphicon glyphicon-edit"></i> 修改
                            </button>
                            <!-- Indicates a dangerous or potentially negative action -->
                            <button shiro:hasPermission="customer:delete" type="button" id="deleteBtn" class="btn btn-default" data-toggle="modal"
                                    data-target="#deleteModal"
                                    data-action="{type:'delete',form:'#deleteForm',idField:'id',table:'#table'}"
                                    disabled><i class="glyphicon glyphicon-remove"></i> 删除
                            </button>
                            <button shiro:hasPermission="customer:view" type="button" id="importBtn" class="btn btn-default"
                                    data-toggle="modal"
                                    data-target="#importModal"><i class="glyphicon glyphicon-plus"></i> 导入
                            </button>
                        </div>
                    </div>
                   <table id="table"></table>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->

        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</section>
<!-- /.content -->

<!-- add Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="addModalLabel">添加客户</h4>
            </div>
            <div class="modal-body">
                <form id="addForm">
                    <input type="hidden" id="bindBizIds" name="bindBizIds" />
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="username"><span class="asterisk">*</span>客户姓名:</label>
                        <div class="col-sm-4">
                            <input  type="text" class="form-control" id="username" name="username" placeholder="输入姓名" minlength="2">
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="phone"><span
                                class="asterisk">*</span>手机号码:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="phone" minlength="11" name="phone" placeholder="手机号码" minlenth="11">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="asterisk">*</span>性别:</label>
                        <div class="col-sm-4 control-label">
                            <label>
                                    <input type="radio" class="minimal-red" name="sex" value="1" checked>男
                                <div class="help-block with-errors"></div>
                            </label>
                            <label>
                                <input type="radio" class="minimal-red" name="sex" value="0" >女
                                <div class="help-block with-errors"></div>
                            </label>

                        </div>
                        <label class="col-sm-2 control-label" for="channel"><span
                                class="asterisk">*</span>客户渠道:</label>
                        <div class="col-sm-4">
                            <select class="form-control select"  id="channel" name="channel"  data-placeholder="选择客户渠道">
                                <option value="1" text="电话服务">电话服务</option>
                                <option value="2" text="营销方案">营销方案</option>
                                <option value="3" text="服务站">服务站</option>
                                <option value="4" text="个人微信">个人微信</option>
                                <option value="5" text="微信">微信</option>
                                <option value="6" text="移动促销">移动促销</option>
                                <option value="7" text="自营促销">自营促销</option>
                                <option value="8" text="亲友推荐">亲友推荐</option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="packageMain"><span class="asterisk">*</span>主套餐:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="packageMain" name="packageMain"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="flow"><span class="asterisk">*</span>流量:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="flow" name="flow"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="bizType"><span class="asterisk">*</span>业务类型:</label>
                        <div class="col-sm-4">
                            <select class="form-control select" id="bizType" name="bizType"  data-placeholder="业务类型">
                                <option value="0" text="新开户">新开户</option>
                                <option value="1" text="宽带">宽带</option>
                                <option value="2" text="终端">终端</option>
                                <option value="3" text="套餐流量">套餐流量</option>
                                <option value="4" text="基础业务">基础业务</option>
                                <option value="5" text="手机配件">手机配件</option>
                                <option value="6" text="核心业务">核心业务</option>
                                <option value="7" text="非核心业务">非核心业务</option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="bindBiz"><span class="asterisk">*</span>捆绑业务:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="bindBiz" name="bindBiz"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                     </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="intention"><span class="asterisk">*</span>消费意向:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="intention" name="intention"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="label"><span class="asterisk">*</span>用户标签:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="label" name="label"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label" for="status"><span class="asterisk">*</span>跟进状态:</label>
                        <div class="col-sm-4">
                            <select class="form-control select" id="status" name="status"  data-placeholder="跟进状态" required>
                                <option value="0" text="已办理">已办理</option>
                                <option value="1" text="有意向">有意向</option>
                                <option value="2" text="继续跟进">继续跟进</option>
                                <option value="3" text="未处理">未处理</option>
                                <option value="4" text="不需要">不需要</option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                         <label class="col-sm-2 control-label" for="settleDay"><span
                                 class="asterisk">*</span>结算日期:</label>
                         <div class="col-sm-4">
                             <input type="text" class="form-control" id="settleDay" minlength="1"
                                    name="settleDay" placeholder="结算日期"
                                    required>
                             <div class="help-block with-errors"></div>
                         </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="userId"><span class="asterisk">*</span>处理人:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="userId" name="userId"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="userIds"><span class="asterisk">*</span>协助处理人:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="userIds" name="userIds"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" form="addForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#addForm',url:'@{/customer/create}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>
<!-- edit Modal -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="editModalLabel">修改用户</h4>
            </div>
            <div class="modal-body">
                <form id="editForm">
                    <input type="hidden"  name="id" />
                    <input type="hidden" id="editbindBizIds" name="bindBizIds" />
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="username"><span class="asterisk">*</span>客户姓名:</label>
                        <div class="col-sm-4">
                            <input  type="text" class="form-control" id="editusername" name="username" placeholder="输入姓名"
                                    minlength="2">
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="editphone"><span
                                class="asterisk">*</span>手机号码:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editphone" minlength="11"
                                   name="phone" placeholder="手机号码"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="asterisk">*</span>性别:</label>
                        <div class="col-sm-4 control-label">
                            <label>
                                <input type="radio" class="minimal-red" name="sex" value="1" checked>男
                            </label>
                            <label>
                                <input type="radio" class="minimal-red" name="sex" value="0" >女
                            </label>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="editchannel"><span
                                class="asterisk">*</span>客户渠道:</label>
                        <div class="col-sm-4">
                            <select class="form-control select"  id="editchannel" name="channel"  data-placeholder="选择客户渠道">
                                <option value="1" text="电话服务">电话服务</option>
                                <option value="2" text="营销方案">营销方案</option>
                                <option value="3" text="服务站">服务站</option>
                                <option value="4" text="个人微信">个人微信</option>
                                <option value="5" text="微信">微信</option>
                                <option value="6" text="移动促销">移动促销</option>
                                <option value="7" text="自营促销">自营促销</option>
                                <option value="8" text="亲友推荐">亲友推荐</option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="editpackageMain"><span class="asterisk">*</span>主套餐:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editpackageMain" name="packageMain"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="editflow"><span class="asterisk">*</span>流量:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editflow" name="flow"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="editbizType"><span class="asterisk">*</span>业务类型:</label>
                        <div class="col-sm-4">
                            <select class="form-control select" id="editbizType" name="bizType"  data-placeholder="业务类型">
                                <option value="0" text="新开户">新开户</option>
                                <option value="1" text="宽带">宽带</option>
                                <option value="2" text="终端">终端</option>
                                <option value="3" text="套餐流量">套餐流量</option>
                                <option value="4" text="基础业务">基础业务</option>
                                <option value="5" text="手机配件">手机配件</option>
                                <option value="6" text="核心业务">核心业务</option>
                                <option value="7" text="非核心业务">非核心业务</option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="editbindBiz"><span class="asterisk">*</span>捆绑业务:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editbindBiz" name="bindBiz"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="editintention"><span class="asterisk">*</span>消费意向:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editintention" name="intention"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="editlabel"><span class="asterisk">*</span>用户标签:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editlabel" name="label"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="editstatus"><span class="asterisk">*</span>跟进状态:</label>
                        <div class="col-sm-4">
                            <select class="form-control select" id="editstatus" name="status"  data-placeholder="跟进状态" required>
                                <option value="0" text="已办理">已办理</option>
                                <option value="1" text="有意向">有意向</option>
                                <option value="2" text="继续跟进">继续跟进</option>
                                <option value="3" text="未处理">未处理</option>
                                <option value="4" text="不需要">不需要</option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="editsettleDay"><span
                                class="asterisk">*</span>结算日期:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="editsettleDay" minlength="1"
                                   name="settleDay" placeholder="结算日期"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="edituserId"><span class="asterisk">*</span>处理人:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="edituserId" name="userId"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                        <label class="col-sm-2 control-label" for="edituserIds"><span class="asterisk">*</span>协助处理人:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="edituserIds" name="userIds"
                                   required>
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" form="editForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#editForm',url:'@{/customer/update}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>

<!-- delete modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="deleteSmallModalLabel">删除用户</h4>
            </div>
            <div class="modal-body">
                <form id="deleteForm"></form>
                确定要删除选中的 <span class="records"></span> 条记录?
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" form="deleteForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#deleteForm',url:'@{/customer/delete}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>

<!-- import modeal -->
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="importModalLabel">上传客户信息</h4>
            </div>
            <fieldset>
            <div class="modal-body">
                <form id="importForm">
                    <input type="hidden" id="importpathfile" name="importpathfile" />
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="import"><span
                                class="asterisk">*</span>上传文件:</label>
                        <div class="col-sm-10 controls">
                            <input type="file" multiple="multiple" id="import" name="import" data-show-caption="true" />
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                </form>
            </div>
            </fieldset>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" form="addForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#importForm',url:'@{/customer/import}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>


<div id="actionButtons" class="admin-hide">
    <a class="like" href="javascript:void(0)" data-toggle="tooltip" title="Like"><i class="glyphicon glyphicon-heart"></i></a>　
    <a shiro:hasPermission="customer:update" class="edit ml10" href="javascript:void(0)" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>　
    <a shiro:hasPermission="customer:delete" class="remove ml10" href="javascript:void(0)" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-remove"></i></a>　
</div>

<script th:inline="javascript">
    var $table = $('#table');

    $(function () {
        // bootstrap table初始化
        // http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/
        $table.bootstrapTable({
            url: CONTEXT_PATH + '/customer/list',
            idField: 'id',
            columns: [
                {field: 'state', checkbox: true},
                {field: 'id', title: '编号', sortable: true, halign: 'left'},
                {field: 'username', title: '用户名', sortable: true, halign: 'left'},
                {field: 'phone', title: '手机号码', sortable: true, halign: 'left'},
             /*   {field: 'sex', title: '性别', sortable: true, halign: 'left',formatter:sexformatter},
                {field: 'channel', title: '渠道', sortable: true, halign: 'left'},*/
                {field: 'settleDay', title: '结算日', sortable: true, halign: 'left'},
                {field: 'packageMain', title: '主套餐', sortable: true, halign: 'left'},
                {field: 'bindBiz', title: '话费', sortable: true, halign: 'left'},
                {field: 'flow', title: '流量', sortable: true, halign: 'left'},
                {field: 'label', title: '分包批次', sortable: true, halign: 'left'},
                {field: 'intention', title: '分包', sortable: true, halign: 'left'},
                {field: 'status', title: '客户状态名称', sortable: true, halign: 'left',formatter:statusformatter},
                /*{field: 'userId', title: '处理人', sortable: true, halign: 'left'},
                {field: 'userIds', title: '协助处理人', sortable: true, halign: 'left'},*/
                {
                    field: 'action',
                    title: '操作',
                    halign: 'center',
                    align: 'center',
                    formatter: 'actionFormatter',
                    events: 'actionEvents',
                    clickToSelect: false
                }
            ]
        });

        <!--上传组件初始化-->
        initFileInput("import");
    });

    function sexformatter(sex) {
         var value,color;
         if (sex == "0") { color = 'Red'; value="女" }
          else if (sex == "1") { color = 'Green'; value="男"}
          else { color = 'Yellow'; value="未知" }
          return '<div  style="color: ' + color + '">' + value + '</div>';
    }
   function statusformatter(status){
        console.log("状态="+status);
        var ret ;
        switch(status){
            case('0'):
                ret = '已办理';
                break;
           case('1'):
               break;
           ret = '有意向';
           case('2'):
           ret = '继续跟进';
           break;
           case('3'):
           ret = '未处理';
           break;
           case('4'):
            ret = '不需要';
            break;
            default:
               ret = "不需要";
               break;
       }
       return '<div>'+ret+'</div>';
   }

    // 数据表格展开内容
    function detailFormatter(index, row) {
        var html = [];
        $.each(row, function (key, value) {
            html.push('<p><b>' + key + ':</b> ' + value + '</p>');
        });
        return html.join('');
    }

    function editAfter(obj, row) {
        <!--一个用户有几个角色，几个组-->
/*        var roleIdList = row.roleIdList;
        var groupIdList = row.groupIdList;
        for (i in roleIdList) {
            var roleId = roleIdList[i];
            $('#editForm').find('[name=roleIds]').find('option[value=' + roleId + ']').prop('selected', true);
        }
        for(i in groupIdList) {
            var groupId = groupIdList[i];
            $('#editForm').find('[name=groupIds]').find('option[value=' + groupId + ']').prop('selected', true);
        }
        //初始化fileinput
        initFileInput("editheadImag");*/
    }

    function actionFormatter(value, row, index) {
        console.log("生成增删查改 button");
        return $('#actionButtons').html();
    }

    window.actionEvents = {
        'click .like': function (e, value, row, index) {
            alert('You click like icon, row: ' + JSON.stringify(row));
            console.log(value, row, index);
        },
        'click .edit': function (e, value, row, index) {
            $('#editModal').modal('show')
            $('#editForm').fillForm(row);
            editAfter('', row);
            console.log(value, row, index);
        },
        'click .remove': function (e, value, row, index) {
            $('#deleteModal').modal('show');
            $('.records').html('1');
            var html = '';
            for (var key in row) {
                html += '<input type="hidden" name="' + key + '" value="' + row[key] + '">';
            }
            $('#deleteForm').html(html);
        }
    };
   <!--文件上传组件-->
    function initFileInput(ctrlName) {
        var control = $('#' + ctrlName);
        control.fileinput({
            language: 'zh', //设置语言
            uploadUrl: CONTEXT_PATH + '/fileserver/upload', //上传的地址
            allowedFileExtensions: ['xlsx', 'xls'],//接收的文件后缀
            uploadAsync: true, //默认异步上传
            showUpload: true, //是否显示上传按钮
            showRemove : true, //显示移除按钮
            showPreview : true, //是否显示预览
            showCaption: false,//是否显示标题
            browseClass: "btn btn-primary", //按钮样式
            maxFileCount: 1, //允许同时上传的最大文件个数
            enctype: 'multipart/form-data',
            validateInitialCount:true,
            msgFilesTooMany: "选择上传的文件数量({n}) 超过允许的最大数值{m}！",// "id": $('#headImag').val(),
            uploadExtraData:function (previewId, index) {           //传参
                var data = {
                    "previewId": previewId,      //此处自定义传参
                    "inputId": ctrlName,//上传input的id
                    "destDir": '/customer/import'
                };
                return data;
            }

        }).on('filepreupload', function(event, data, previewId, index) {     //上传中
            console.log('文件正在上传');
        }).on("fileuploaded", function (event, data, previewId, index) {    //一个文件上传成功
            var form = data.form, files = data.files, extra = data.extra,
                response = data.response, reader = data.reader;
            //console.log("上传文件保存路径="+response.tagPathFile);
            //console.log(response);//打印出返回的json
            //console.log(response.data.tagPathFile);//打印出路径
            $("#importpathfile").val(response.data.tagPathFile);
        }).on('fileerror', function(event, data, msg) {  //一个文件上传失败
            console.log('文件上传失败！'+data.status);
        })
    }
</script>
</html>